<?php
if(isset($_POST["setlang"]) && array_key_exists($_POST["setlang"], $langs))
	$set_lang = $_POST["setlang"];
else if(isset($_COOKIE["lang"]) && array_key_exists($_COOKIE["lang"], $langs))
	$set_lang = $_COOKIE["lang"];
else
	$set_lang = english;

setcookie("lang", $set_lang, $cookie_expire);
$langfile = "language_files/".$set_lang.".php";

if(file_exists($langfile))
	require $langfile;
?>